package com.runvp.service.biz.service.impl;

import java.util.List;
import com.runvp.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.runvp.service.biz.mapper.BizOrderItemMapper;
import com.runvp.service.biz.domain.BizOrderItem;
import com.runvp.service.biz.service.IBizOrderItemService;
import com.runvp.common.core.text.Convert;

/**
 * 订单商品Service业务层处理
 * 
 * @author runvp
 * @date 2022-12-27
 */
@Service
public class BizOrderItemServiceImpl implements IBizOrderItemService {
    @Autowired
    private BizOrderItemMapper bizOrderItemMapper;

    /**
     * 查询订单商品
     * 
     * @param id 订单商品主键
     * @return 订单商品
     */
    @Override
    public BizOrderItem selectBizOrderItemById(Long id) {
        return bizOrderItemMapper.selectBizOrderItemById(id);
    }

    /**
     * 查询订单商品列表
     * 
     * @param bizOrderItem 订单商品
     * @return 订单商品
     */
    @Override
    public List<BizOrderItem> selectBizOrderItemList(BizOrderItem bizOrderItem) {
        return bizOrderItemMapper.selectBizOrderItemList(bizOrderItem);
    }

    /**
     * 新增订单商品
     * 
     * @param bizOrderItem 订单商品
     * @return 结果
     */
    @Override
    public int insertBizOrderItem(BizOrderItem bizOrderItem) {
        bizOrderItem.setCreateTime(DateUtils.getNowDate());
        return bizOrderItemMapper.insertBizOrderItem(bizOrderItem);
    }

    /**
     * 修改订单商品
     * 
     * @param bizOrderItem 订单商品
     * @return 结果
     */
    @Override
    public int updateBizOrderItem(BizOrderItem bizOrderItem) {
        return bizOrderItemMapper.updateBizOrderItem(bizOrderItem);
    }

    /**
     * 批量删除订单商品
     * 
     * @param ids 需要删除的订单商品主键
     * @return 结果
     */
    @Override
    public int deleteBizOrderItemByIds(String ids) {
        return bizOrderItemMapper.deleteBizOrderItemByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除订单商品信息
     * 
     * @param id 订单商品主键
     * @return 结果
     */
    @Override
    public int deleteBizOrderItemById(Long id) {
        return bizOrderItemMapper.deleteBizOrderItemById(id);
    }
}
